package com.atguigu.java.ai.langchain4j.assistant;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

/**
 * @Author huoyz
 * @Date 2025/5/9 19:26
 * @Version 1.0
 * @description: 创建Ai小智的智能助手
 *  用户实现聊天记忆，对话条数为20条，以及mongodb的持久化操作chatMemoryProvider
 *  XiaoZhiAgentConfig配置文件中xiaoZhiMemory()
 *
 *  通过查chuat传到XiaoZhiAgentConfig配置文件中xiaoZhiMemory()里面
 *
 *  @AiService() 用于实现聊天记忆
 */

@AiService(
        wiringMode = EXPLICIT,
        chatModel = "qwenChatModel",  //指定模型千问
//        streamingChatModel = "qwenStreamingChatModel",
        chatMemoryProvider = "xiaoZhiMemory", //用户实现聊天记忆，对话条数为20条，以及mongodb的持久化操作chatMemoryProvider
        tools = "appointmentTools"   //工具类中实现预约方法
//        contentRetriever = "contentRetrieverXiaoZhi"  //配置向量存储 大模型没有的从本地知识库获取
        //contentRetriever = "contentRetrieverXiaozhiPincone"  //配置向量存储 大模型没有的从peaceone中获取（本地上传到peaceone）
)
public interface XiaoZhiAgent {
        @SystemMessage(fromResource = "xiaozhi-hospital-words.txt")
        String chat(@MemoryId Long memoryId, @UserMessage String message);
}
